let contactNumberModel = require("../models/contactNumberList").contactNumberList;

let contactNumberDAO = function (){};

contactNumberDAO.prototype = {
  //增
  save: function (json, callBack){
    let newContactNumber = new contactNumberModel(json);
    newContactNumber.save(function (err){
      callBack(err);
    });
  },
  //删
  remove: function (json, callBack){
    contactNumberModel.remove(json, function (err){
      callBack(err);
    });
  },
  //改
  update: function (json, condition, callBack){
    contactNumberModel.update(json, condition, function (err){
      callBack(err);
    });
  },
  //查
  findOne: function (json, callBack){
    contactNumberModel.findOne(json, function (err, doc){
      callBack(err, doc);
    });
  },
  // 查询全部列表
  findAll: function ( callBack){
    contactNumberModel.find(function (err, doc){
      callBack(err, doc);
    });
  },
};

exports.contactNumberMethod = new contactNumberDAO();
